package com.shqcjd.sinopecdemomobile.api;

import com.lzy.okgo.OkGo;
import com.lzy.okrx2.adapter.ObservableBody;
import com.shqcjd.sinopecdemomobile.helper.JsonConvert;
import com.shqcjd.sinopecdemomobile.model.DefectInfoBean;
import com.shqcjd.sinopecdemomobile.model.ResponseData;
import com.shqcjd.sinopecdemomobile.model.pojo.AllTaskBean;
import com.shqcjd.sinopecdemomobile.model.pojo.AppOperationGuideMode;
import com.shqcjd.sinopecdemomobile.model.pojo.ChannelUser;
import com.shqcjd.sinopecdemomobile.model.pojo.AbnormalBean;
import com.shqcjd.sinopecdemomobile.model.pojo.DefectManageBean;
import com.shqcjd.sinopecdemomobile.model.pojo.DefectManageTypeBean;
import com.shqcjd.sinopecdemomobile.model.pojo.EquipmentAbnormalBean;
import com.shqcjd.sinopecdemomobile.model.pojo.EquipmentGroupBean;
import com.shqcjd.sinopecdemomobile.model.pojo.EquipmentInfoBean;
import com.shqcjd.sinopecdemomobile.model.pojo.EquipmentInfoInspectBean;
import com.shqcjd.sinopecdemomobile.model.pojo.EquipmentInspectionBean;
import com.shqcjd.sinopecdemomobile.model.pojo.EquipmentListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ExpertBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ExpertListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ExpertReplyDetailBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ExpertReplyListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.FileBean;
import com.shqcjd.sinopecdemomobile.model.pojo.GuideListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.IndexBean;
import com.shqcjd.sinopecdemomobile.model.pojo.InspectionRecordBean;
import com.shqcjd.sinopecdemomobile.model.pojo.InspectionStandardBean;
import com.shqcjd.sinopecdemomobile.model.pojo.InspectionListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.InspectionTaskBean;
import com.shqcjd.sinopecdemomobile.model.pojo.IntentEquipmentBean;
import com.shqcjd.sinopecdemomobile.model.pojo.KnowledgeBean;
import com.shqcjd.sinopecdemomobile.model.pojo.KnowledgeInfoBean;
import com.shqcjd.sinopecdemomobile.model.pojo.LoginBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ManageDynamicDataDictionary;
import com.shqcjd.sinopecdemomobile.model.pojo.MoreImgListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.MsgBean;
import com.shqcjd.sinopecdemomobile.model.pojo.PlayBackBean;
import com.shqcjd.sinopecdemomobile.model.pojo.PointInfoBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ProblemDetailBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ProblemFeedbackListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ProblemListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.ProblemType;
import com.shqcjd.sinopecdemomobile.model.pojo.ProcessBackBean;
import com.shqcjd.sinopecdemomobile.model.pojo.NewsDetailBean;
import com.shqcjd.sinopecdemomobile.model.pojo.NewsListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.RouteInfoBean;
import com.shqcjd.sinopecdemomobile.model.pojo.RouteInfoListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.RouteListBean;
import com.shqcjd.sinopecdemomobile.model.pojo.RouteQueryBean;
import com.shqcjd.sinopecdemomobile.model.pojo.StateInspectionRecordBean;
import com.shqcjd.sinopecdemomobile.model.pojo.TaskCodeBean;
import com.shqcjd.sinopecdemomobile.model.pojo.TrajectoryPoint;
import com.shqcjd.sinopecdemomobile.model.pojo.UploadFileRet;
import com.shqcjd.sinopecdemomobile.model.pojo.TreeNode;

import org.json.JSONObject;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;

/**
 * Created by sy on 2019/3/14.
 */

public class ApiService {
    public static Observable<ResponseData<LoginBean>> login(JSONObject loginBean) {
        return OkGo.<ResponseData<LoginBean>>post(HttpUrl.LOGIN)
                .upJson(loginBean)
                .converter(new JsonConvert<ResponseData<LoginBean>>(){})
                .adapt(new ObservableBody<ResponseData<LoginBean>>());

    }

    public static Observable<ResponseData<IndexBean>> index(){
        return OkGo.<ResponseData<IndexBean>>get(HttpUrl.INDEX_DATA)
                .converter(new JsonConvert<ResponseData<IndexBean>>(){})
                .adapt(new ObservableBody<ResponseData<IndexBean>>());
    }

    public static Observable<ResponseData<InspectionListBean>> getInspectionList(JSONObject parameter){
        return OkGo.<ResponseData<InspectionListBean>>post(HttpUrl.GET_TASK_LIST)
                .upJson(parameter)
                .converter(new JsonConvert<ResponseData<InspectionListBean>>(){})
                .adapt(new ObservableBody<ResponseData<InspectionListBean>>());

    }

    public static Observable<ResponseData<GuideListBean>> getGuideList(JSONObject parameter){
        return OkGo.<ResponseData<GuideListBean>>post(HttpUrl.GET_GUIDE_LIST)
                .upJson(parameter)
                .converter(new JsonConvert<ResponseData<GuideListBean>>(){})
                .adapt(new ObservableBody<ResponseData<GuideListBean>>());

    }

    public static Observable<ResponseData<ExpertListBean>> getExpertList(JSONObject parameter){
        return OkGo.<ResponseData<ExpertListBean>>post(HttpUrl.GET_EXPERT_LIST)
                .upJson(parameter)
                .converter(new JsonConvert<ResponseData<ExpertListBean>>(){})
                .adapt(new ObservableBody<ResponseData<ExpertListBean>>());

    }

    public static Observable<ResponseData<ExpertBean>> getExper(int id){
        return OkGo.<ResponseData<ExpertBean>>get(HttpUrl.GET_EXPERT)
                .params("id", id)
                .converter(new JsonConvert<ResponseData<ExpertBean>>() {
                })
                .adapt(new ObservableBody<ResponseData<ExpertBean>>());

    }

    public static Observable<ResponseData<RouteListBean>> routeListHttp(JSONObject routeBean) {
        return OkGo.<ResponseData<RouteListBean>>post(HttpUrl.ROUTE_LIST)
                .upJson(routeBean)
                .converter(new JsonConvert<ResponseData<RouteListBean>>(){})
                .adapt(new ObservableBody<ResponseData<RouteListBean>>());

    }

    public static Observable<ResponseData<RouteInfoBean>> routeInfoHttp(int rId) {
        return OkGo.<ResponseData<RouteInfoBean>>get(HttpUrl.ROUTE_INFO+"?id="+rId)
                .converter(new JsonConvert<ResponseData<RouteInfoBean>>(){})
                .adapt(new ObservableBody<ResponseData<RouteInfoBean>>());
    }

    public static Observable<ResponseData<RouteInfoListBean>> routeInfoListHttp(int pageIndex, int pageSize, int rId) {
        return OkGo.<ResponseData<RouteInfoListBean>>get(HttpUrl.ROUTE_INFO_LIST+"?pageIndex="+pageIndex+"&pageSize="+pageSize+"&patrol_route_id="+rId)
                .converter(new JsonConvert<ResponseData<RouteInfoListBean>>(){})
                .adapt(new ObservableBody<ResponseData<RouteInfoListBean>>());
    }

    public static Observable<ResponseData<InspectionStandardBean>> inspectionStandardHttp(int eId) {
        return OkGo.<ResponseData<InspectionStandardBean>>get(HttpUrl.INSPECTION_STANDARD+"?equipment_id="+eId)
                .converter(new JsonConvert<ResponseData<InspectionStandardBean>>(){})
                .adapt(new ObservableBody<ResponseData<InspectionStandardBean>>());
    }

    public static Observable<ResponseData<DefectInfoBean>> defectInfoHttp(int dId) {
        return OkGo.<ResponseData<DefectInfoBean>>get(HttpUrl.DEFECT_INFO+"?id="+dId)
                .converter(new JsonConvert<ResponseData<DefectInfoBean>>(){})
                .adapt(new ObservableBody<ResponseData<DefectInfoBean>>());
    }

    public static Observable<ResponseData<DefectManageBean>> defectManageHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<DefectManageBean>>post(HttpUrl.DEFECT_MANAGE_LIST)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<DefectManageBean>>(){})
                .adapt(new ObservableBody<ResponseData<DefectManageBean>>());
    }

    public static Observable<ResponseData<MoreImgListBean>> playBackMoreImgHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<MoreImgListBean>>post(HttpUrl.PLAY_BACK_MORE_IMG_LIST)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<MoreImgListBean>>(){})
                .adapt(new ObservableBody<ResponseData<MoreImgListBean>>());
    }

    public static Observable<ResponseData<EquipmentInfoBean>> equipmentInfoHttp(String kks) {
        return OkGo.<ResponseData<EquipmentInfoBean>>get(HttpUrl.EUIPMENT_INFO+"?kks="+kks)
                .converter(new JsonConvert<ResponseData<EquipmentInfoBean>>(){})
                .adapt(new ObservableBody<ResponseData<EquipmentInfoBean>>());
    }


    public static Observable<ResponseData<EquipmentInfoInspectBean>> equipmentInfoInspectRecordHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<EquipmentInfoInspectBean>>post(HttpUrl.INSPECT_RECORD)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<EquipmentInfoInspectBean>>(){})
                .adapt(new ObservableBody<ResponseData<EquipmentInfoInspectBean>>());
    }


    public static Observable<ResponseData<NewsListBean>> getNewsList(JSONObject parameter){
        return OkGo.<ResponseData<NewsListBean>>post(HttpUrl.GET_NEWS_LIST)
                .upJson(parameter)
                .converter(new JsonConvert<ResponseData<NewsListBean>>(){})
                .adapt(new ObservableBody<ResponseData<NewsListBean>>());

    }


    public static Observable<ResponseData<NewsDetailBean>> getNewsDetail(int id){
        return OkGo.<ResponseData<NewsDetailBean>>get(HttpUrl.GET_NEWS_DETAIL)
                .params("id", id)
                .converter(new JsonConvert<ResponseData<NewsDetailBean>>() {
                })
                .adapt(new ObservableBody<ResponseData<NewsDetailBean>>());

    }

    public static Observable<ResponseData<EquipmentGroupBean>> equipmentGroupHttp(int tId, String kks) {
        return OkGo.<ResponseData<EquipmentGroupBean>>get(HttpUrl.EQUIPMENT_GROUP+"?kks="+kks+"&task_id="+tId)
                .converter(new JsonConvert<ResponseData<EquipmentGroupBean>>(){})
                .adapt(new ObservableBody<ResponseData<EquipmentGroupBean>>());
    }

    public static Observable<ResponseData<EquipmentAbnormalBean>> equipmentAbnormalHttp(int tId, int eId) {
        return OkGo.<ResponseData<EquipmentAbnormalBean>>get(HttpUrl.EQUIPMENT_ABNORMAL+"?equipment_id="+eId+"&task_id="+tId)
                .converter(new JsonConvert<ResponseData<EquipmentAbnormalBean>>(){})
                .adapt(new ObservableBody<ResponseData<EquipmentAbnormalBean>>());
    }

    public static Observable<ResponseData<EquipmentInspectionBean>> equipmentInspectionHttp(int task_id, String kks) {
        return OkGo.<ResponseData<EquipmentInspectionBean>>get(HttpUrl.EQUIPMENT_INSPECTION+"?task_id="+task_id+"&kks="+kks)
                .converter(new JsonConvert<ResponseData<EquipmentInspectionBean>>(){})
                .adapt(new ObservableBody<ResponseData<EquipmentInspectionBean>>());
    }

    public static Observable<ResponseData<StateInspectionRecordBean>> equipmentGroupRecordHttp(int task_id, String kks) {
        return OkGo.<ResponseData<StateInspectionRecordBean>>get(HttpUrl.EQUIPMENT_INSPECTION+"?task_id="+task_id+"&kks="+kks)
                .converter(new JsonConvert<ResponseData<StateInspectionRecordBean>>(){})
                .adapt(new ObservableBody<ResponseData<StateInspectionRecordBean>>());
    }

    public static Observable<ResponseData<PlayBackBean>> playBackHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<PlayBackBean>>post(HttpUrl.PLAY_BACK)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<PlayBackBean>>(){})
                .adapt(new ObservableBody<ResponseData<PlayBackBean>>());
    }

    public static Observable<ResponseData<ProcessBackBean>> processBackHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<ProcessBackBean>>post(HttpUrl.PROCESS_BACK)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<ProcessBackBean>>(){})
                .adapt(new ObservableBody<ResponseData<ProcessBackBean>>());
    }

    public static Observable<ResponseData<EquipmentListBean>> equipmentListHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<EquipmentListBean>>post(HttpUrl.EUIPMENT_LIST)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<EquipmentListBean>>(){})
                .adapt(new ObservableBody<ResponseData<EquipmentListBean>>());
    }

    public static Observable<ResponseData<InspectionRecordBean>> inspectRecordHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<InspectionRecordBean>>post(HttpUrl.INSPECT_RECORD)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<InspectionRecordBean>>(){})
                .adapt(new ObservableBody<ResponseData<InspectionRecordBean>>());
    }

    public static Observable<ResponseData<IntentEquipmentBean>> intentEquipmentHttp(String kks, int task_id) {
        return OkGo.<ResponseData<IntentEquipmentBean>>get(HttpUrl.INTENT_EQUIPMENT+"?kks="+kks+"&task_id="+task_id)
                .converter(new JsonConvert<ResponseData<IntentEquipmentBean>>(){})
                .adapt(new ObservableBody<ResponseData<IntentEquipmentBean>>());
    }

    public static Observable<ResponseData<List<DefectManageTypeBean>>> defectManageTypeHttp() {
        return OkGo.<ResponseData<List<DefectManageTypeBean>>>get(HttpUrl.DEFECT_MANAGE_TYPE)
                .converter(new JsonConvert<ResponseData<List<DefectManageTypeBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<DefectManageTypeBean>>>());
    }

    public static Observable<ResponseData<List<DefectManageTypeBean>>> playBackTypeHttp() {
        return OkGo.<ResponseData<List<DefectManageTypeBean>>>get(HttpUrl.PLAY_BACK_TYPE)
                .converter(new JsonConvert<ResponseData<List<DefectManageTypeBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<DefectManageTypeBean>>>());
    }

    public static Observable<ResponseData<Integer>> putCheckResultHttp(JSONObject jsonObject) {
        return OkGo.<ResponseData<Integer>>post(HttpUrl.PUT_CHECK_RESULT)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData> openOrCloseSwitchHttp(String kks) {
        return OkGo.<ResponseData>get(HttpUrl.OPEN_OR_CLOSE_EQUIPMENT+"?kks="+kks)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }

    public static Observable<ResponseData<List<PointInfoBean>>> routePointInfoHttp(int patrol_point_id, int patrol_route_id) {
        return OkGo.<ResponseData<List<PointInfoBean>>>get(HttpUrl.ROUTE_POINT_INFO+"?patrol_point_id="+patrol_point_id+"&patrol_route_id="+patrol_route_id)
                .converter(new JsonConvert<ResponseData<List<PointInfoBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<PointInfoBean>>>());
    }

    /**
     * 独立设备巡检页 点击读取按钮的接口
     * @return
     */
    public static Observable<ResponseData<String>> equipmentInspectionButtonHttp(String url, int equipmentId, String type, int equipmentPartItemId) {
        return OkGo.<ResponseData<String>>get(url+"?equipmentId="+equipmentId+"&type="+type+"&equipmentPartItemId="+equipmentPartItemId)
                .converter(new JsonConvert<ResponseData<String>>(){})
                .adapt(new ObservableBody<ResponseData<String>>());
    }
    public static Observable<ResponseData> createGuide(JSONObject jsonObject) {
        return OkGo.<ResponseData>post(HttpUrl.CREATE_GUIDE)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }

    public static Observable<ResponseData<FileBean>> uploadFile(File file,String taskId) {
        return OkGo.<ResponseData<FileBean>>post(HttpUrl.UPLOAD_FILE+taskId)
                .params("file", file)
                .converter(new JsonConvert<ResponseData<FileBean>>(){})
                .adapt(new ObservableBody<ResponseData<FileBean>>());
    }

    public static Observable<ResponseData> sendFile(JSONObject jsonObject) {
        return OkGo.<ResponseData>post(HttpUrl.SEND_FILE)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }

    public static Observable<ResponseData<List<FileBean>>> getFileList(String roomId) {
        return OkGo.<ResponseData<List<FileBean>>>get(HttpUrl.GET_FILE_LIST+roomId)
                .converter(new JsonConvert<ResponseData<List<FileBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<FileBean>>>());
    }

    public static Observable<ResponseData> handleGuide(JSONObject jsonObject) {
        return OkGo.<ResponseData>post(HttpUrl.HANDLE_GUIDE)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }

    public static Observable<ResponseData<String>> word2pf(String url) {
        return OkGo.<ResponseData<String>>post(HttpUrl.WORD_2_PDF)
                .params("url",url)
                .converter(new JsonConvert<ResponseData<String>>(){})
                .adapt(new ObservableBody<ResponseData<String>>());
    }

    public static Observable<ResponseData<List<FileBean>>> getGuideFileList(int id) {
        return OkGo.<ResponseData<List<FileBean>>>get(HttpUrl.GUIDE_FILE_LIST)
                .params("remoteGuideId",id)
                .converter(new JsonConvert<ResponseData<List<FileBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<FileBean>>>());
    }

    public static Observable<ResponseData<MsgBean>> getMsgList(int pageIndex,int pageSize) {
        return OkGo.<ResponseData<MsgBean>>get(HttpUrl.MSG_LIST)
                .params("pageIndex",pageIndex)
                .params("pageSize",pageSize)
                .converter(new JsonConvert<ResponseData<MsgBean>>(){})
                .adapt(new ObservableBody<ResponseData<MsgBean>>());
    }

    public static Observable<ResponseData<Integer>> unread() {
        return OkGo.<ResponseData<Integer>>get(HttpUrl.UNREAD)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData<InspectionTaskBean>> getCheckList(int taskId) {
        return OkGo.<ResponseData<InspectionTaskBean>>get(HttpUrl.GET_CHECK_LIST)
                .params("taskId",taskId)
                .params("pageIndex",0)
                .params("pageSize",0)
                .converter(new JsonConvert<ResponseData<InspectionTaskBean>>(){})
                .adapt(new ObservableBody<ResponseData<InspectionTaskBean>>());
    }

    public static Observable<ResponseData<List<String>>> uploadMultiImg(List<File> files) {
        return OkGo.<ResponseData<List<String>>>post(HttpUrl.UPLOAD_MULTI_IMG)
                .addFileParams("file", files)
                .converter(new JsonConvert<ResponseData<List<String>>>(){})
                .adapt(new ObservableBody<ResponseData<List<String>>>());
    }

    public static Observable<ResponseData<String>> uploadMultiFile(File files) {
        return OkGo.<ResponseData<String>>post(HttpUrl.UPLOAD_MULTI_FILE)
                .params("file", files)
                .converter(new JsonConvert<ResponseData<String>>(){})
                .adapt(new ObservableBody<ResponseData<String>>());
    }

    public static Observable<ResponseData<String>> putCheckException(String jsonObject) {
        return OkGo.<ResponseData<String>>post(HttpUrl.PUT_CHECK_EXCEPTION)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<String>>(){})
                .adapt(new ObservableBody<ResponseData<String>>());
    }


    public static Observable<ResponseData<TaskCodeBean>> getRandomTask() {
        return OkGo.<ResponseData<TaskCodeBean>>get(HttpUrl.CREATE_RANDOM_TASK)
                .converter(new JsonConvert<ResponseData<TaskCodeBean>>(){})
                .adapt(new ObservableBody<ResponseData<TaskCodeBean>>());
    }

    public static Observable<ResponseData<List<DefectManageTypeBean>>> getInspectionUser() {
        return OkGo.<ResponseData<List<DefectManageTypeBean>>>get(HttpUrl.GET_INSPECTION_USER)
                .converter(new JsonConvert<ResponseData<List<DefectManageTypeBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<DefectManageTypeBean>>>());
    }

    public static Observable<ResponseData> getGroupTrue(int task_id, int equipment_id) {
        return OkGo.<ResponseData>get(HttpUrl.GET_GROUP_TRUE+"?task_id="+task_id+"&equipment_id="+equipment_id)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }

    public static Observable<ResponseData<List<ProblemType>>> getTypeList(String parentCode) {
        return OkGo.<ResponseData<List<ProblemType>>>get(HttpUrl.GET_PROBLEM_TYPE+parentCode)
                .converter(new JsonConvert<ResponseData<List<ProblemType>>>(){})
                .adapt(new ObservableBody<ResponseData<List<ProblemType>>>());
    }

    public static Observable<ResponseData<List<UploadFileRet>>> uploadMultiAttachment(List<File> files) {
        return OkGo.<ResponseData<List<UploadFileRet>>>post(HttpUrl.UPLOAD_MULTI_ATTACHMENT)
                .addFileParams("file", files)
                .converter(new JsonConvert<ResponseData<List<UploadFileRet>>>(){})
                .adapt(new ObservableBody<ResponseData<List<UploadFileRet>>>());
    }

    public static Observable<ResponseData> submitProblem(String jsonObject) {
        return OkGo.<ResponseData>post(HttpUrl.SUBMIT_PROBLEM)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }

    public static Observable<ResponseData<Integer>> requestGuidance(String jsonObject) {
        return OkGo.<ResponseData<Integer>>post(HttpUrl.REQUEST_GUIDANCE)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData> expertSendMsg(String jsonObject) {
        return OkGo.<ResponseData>post(HttpUrl.EXPERT_SEND_MSG)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }

    public static Observable<ResponseData<ProblemListBean>> problemList(int page,int size,String searchContent) {
        return OkGo.<ResponseData<ProblemListBean>>get(HttpUrl.PROBLEM_LIST)
                .params("page",page)
                .params("size",size)
                .params("searchContent",searchContent)
                .converter(new JsonConvert<ResponseData<ProblemListBean>>(){})
                .adapt(new ObservableBody<ResponseData<ProblemListBean>>());
    }

    public static Observable<ResponseData<ProblemDetailBean>> problemDetails(int problemFeedbackId) {
        return OkGo.<ResponseData<ProblemDetailBean>>get(HttpUrl.PROBLEM_DETAILS+problemFeedbackId)
                .converter(new JsonConvert<ResponseData<ProblemDetailBean>>(){})
                .adapt(new ObservableBody<ResponseData<ProblemDetailBean>>());
    }

    public static Observable<ResponseData<ChannelUser>> queryChannelUser(String roomId) {
        return OkGo.<ResponseData<ChannelUser>>get(HttpUrl.QUERY_CHANNEL_USER+roomId)
                .converter(new JsonConvert<ResponseData<ChannelUser>>(){})
                .adapt(new ObservableBody<ResponseData<ChannelUser>>());
    }

    public static Observable<ResponseData<List<RouteQueryBean>>> getRouteQuery(String str) {
        return OkGo.<ResponseData<List<RouteQueryBean>>>get(HttpUrl.GET_ROUTE_QUERY+str)
                .converter(new JsonConvert<ResponseData<List<RouteQueryBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<RouteQueryBean>>>());
    }

    public static Observable<ResponseData<KnowledgeInfoBean>> getKnowledgeInfo(int id) {
        return OkGo.<ResponseData<KnowledgeInfoBean>>get(HttpUrl.GET_KNOWLEDGE_INFO+id)
                .converter(new JsonConvert<ResponseData<KnowledgeInfoBean>>(){})
                .adapt(new ObservableBody<ResponseData<KnowledgeInfoBean>>());
    }

    public static Observable<ResponseData<KnowledgeBean>> getKnowledgeList(int page, int size, String str) {
        return OkGo.<ResponseData<KnowledgeBean>>get(HttpUrl.GET_KNOWLEDGE_LIST+"?searchContent="+str+"&size="+size+"&page="+page)
                .converter(new JsonConvert<ResponseData<KnowledgeBean>>(){})
                .adapt(new ObservableBody<ResponseData<KnowledgeBean>>());
    }

    public static Observable<ResponseData> getKnowledgeInfoAgree(int id) {
        return OkGo.<ResponseData>post(HttpUrl.GET_KNOWLEDGE_AGREE)
                .params("knowledgeBaseId", id)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());
    }
    public static Observable<ResponseData<AppOperationGuideMode>> getOperTaskListHttp(JSONObject routeBean) {
        return OkGo.<ResponseData<AppOperationGuideMode>>post(HttpUrl.GET_OPER_TASK_LIST)
                .upJson(routeBean)
                .converter(new JsonConvert<ResponseData<AppOperationGuideMode>>(){})
                .adapt(new ObservableBody<ResponseData<AppOperationGuideMode>>());

    }
    public static Observable<ResponseData<ArrayList<TreeNode>>> getGuideTree(int task_id) {
        return OkGo.<ResponseData<ArrayList<TreeNode>>>get(HttpUrl.GET_GUIDE_TREE+"?taskId="+task_id)
                .converter(new JsonConvert<ResponseData<ArrayList<TreeNode>>>(){})
                .adapt(new ObservableBody<ResponseData<ArrayList<TreeNode>>>());
    }
    public static Observable<ResponseData<ArrayList<ManageDynamicDataDictionary>>> getDataDictionary(String parentCode) {
        return OkGo.<ResponseData<ArrayList<ManageDynamicDataDictionary>>>get(HttpUrl.GET_DATA_DICTIONARY+"/parentCode="+parentCode)
                .converter(new JsonConvert<ResponseData<ArrayList<ManageDynamicDataDictionary>>>(){})
                .adapt(new ObservableBody<ResponseData<ArrayList<ManageDynamicDataDictionary>>>());
    }
    public static Observable<ResponseData<TreeNode.StepDetail>> getStepDetail(int stepIndexId,int taskId) {
        return OkGo.<ResponseData<TreeNode.StepDetail>>get(HttpUrl.GET_STEP_DETAIL+"?stepIndexId="+stepIndexId+"&taskId="+taskId)
                .converter(new JsonConvert<ResponseData<TreeNode.StepDetail>>(){})
                .adapt(new ObservableBody<ResponseData<TreeNode.StepDetail>>());
    }

    public static Observable<ResponseData<TreeNode.StepDetail>> getNextStepDetail(int stepIndexId,int taskId) {
        return OkGo.<ResponseData<TreeNode.StepDetail>>get(HttpUrl.GET_NEXT_STEP+"?stepDetailId="+stepIndexId+"&taskId="+taskId)
                .converter(new JsonConvert<ResponseData<TreeNode.StepDetail>>(){})
                .adapt(new ObservableBody<ResponseData<TreeNode.StepDetail>>());
    }

    public static Observable<ResponseData<TreeNode.StepDetail>> getPrevStepDetail(int stepDetailId, int taskId) {
        return OkGo.<ResponseData<TreeNode.StepDetail>>get(HttpUrl.GET_PREV_STEP+"?stepDetailId="+stepDetailId+"&taskId="+taskId)
                .converter(new JsonConvert<ResponseData<TreeNode.StepDetail>>(){})
                .adapt(new ObservableBody<ResponseData<TreeNode.StepDetail>>());
    }

    public static Observable<ResponseData<ArrayList<String>>> getImageList(int stepDetailId) {
        return OkGo.<ResponseData<ArrayList<String>>>get(HttpUrl.GET_GUIDE_IMG_LIST+"?stepDetailId="+stepDetailId)
                .converter(new JsonConvert<ResponseData<ArrayList<String>>>(){})
                .adapt(new ObservableBody<ResponseData<ArrayList<String>>>());
    }
    public static Observable<ResponseData<ArrayList<String>>> getMediaList(int stepDetailId) {
        return OkGo.<ResponseData<ArrayList<String>>>get(HttpUrl.GET_GUIDE_MEDIA_LIST+"?stepDetailId="+stepDetailId)
                .converter(new JsonConvert<ResponseData<ArrayList<String>>>(){})
                .adapt(new ObservableBody<ResponseData<ArrayList<String>>>());
    }

    public static Observable<ResponseData<Integer>> taskComplete(int workTaskId) {
        return OkGo.<ResponseData<Integer>>get(HttpUrl.GET_TASK_COMPLETE+"?workTaskId="+workTaskId)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData<Integer>> repairTaskComplete(int workTaskId,int stepDetailId) {
        return OkGo.<ResponseData<Integer>>get(HttpUrl.REPAIR_TASK_COMPLETE)
                .params("workTaskId",workTaskId)
                .params("stepDetailId",stepDetailId)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData<Integer>> tipwizardTaskStepComplete(int workTaskId,int stepDetailId) {
        return OkGo.<ResponseData<Integer>>get(HttpUrl.TIPWIZARD_TASK_COMPLETE)
                .params("workTaskId",workTaskId)
                .params("stepIndexId",stepDetailId)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData<Integer>> doGood(int equipmentTypeId,String guideType) {
        return OkGo.<ResponseData<Integer>>get(HttpUrl.GET_OPERTION_GOOD+"?equipmentTypeId="+equipmentTypeId+"&guideType="+guideType)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData<AppOperationGuideMode>> getRepairTaskListHttp(JSONObject routeBean) {
        return OkGo.<ResponseData<AppOperationGuideMode>>post(HttpUrl.POST_REPAIR_TASK)
                .upJson(routeBean)
                .converter(new JsonConvert<ResponseData<AppOperationGuideMode>>(){})
                .adapt(new ObservableBody<ResponseData<AppOperationGuideMode>>());

    }

    public static Observable<ResponseData<TreeNode.StepDetail>> repairNextStepDetail(int stepIndexId,int taskId) {
        return OkGo.<ResponseData<TreeNode.StepDetail>>get(HttpUrl.REPAIR_NEXT_STEP+"?stepDetailId="+stepIndexId+"&workTaskId="+taskId)
                .converter(new JsonConvert<ResponseData<TreeNode.StepDetail>>(){})
                .adapt(new ObservableBody<ResponseData<TreeNode.StepDetail>>());
    }

    public static Observable<ResponseData<TreeNode.StepDetail>> repairPrevStepDetail(int stepDetailId, int workTaskId) {
        return OkGo.<ResponseData<TreeNode.StepDetail>>get(HttpUrl.REPAIR_PREV_STEP+"?stepDetailId="+stepDetailId+"&workTaskId="+workTaskId)
                .converter(new JsonConvert<ResponseData<TreeNode.StepDetail>>(){})
                .adapt(new ObservableBody<ResponseData<TreeNode.StepDetail>>());
    }
    public static Observable<ResponseData<TreeNode.StepDetail>> repairStepDetail(int stepIndexId,int taskId) {
        return OkGo.<ResponseData<TreeNode.StepDetail>>get(HttpUrl.REPAIR_STEP_DETAIL+"?stepDetailId="+stepIndexId+"&taskId="+taskId)
                .converter(new JsonConvert<ResponseData<TreeNode.StepDetail>>(){})
                .adapt(new ObservableBody<ResponseData<TreeNode.StepDetail>>());
    }
    public static Observable<ResponseData<Object>> getRepairPutPhoto(String routeBean) {
        return OkGo.<ResponseData<Object>>post(HttpUrl.PUT_PHOTO)
                .upJson(routeBean)
                .converter(new JsonConvert<ResponseData<Object>>(){})
                .adapt(new ObservableBody<ResponseData<Object>>());

    }

    public static Observable<ResponseData<ProblemFeedbackListBean>> problemFeedbackList(int page,int size,String replyStatus,int userId) {
        return OkGo.<ResponseData<ProblemFeedbackListBean>>get(HttpUrl.PROBLEM_FEEDBACK_LIST)
                .params("page",page)
                .params("size",size)
                .params("replyStatus",replyStatus)
                .params("userId",userId)
                .converter(new JsonConvert<ResponseData<ProblemFeedbackListBean>>(){})
                .adapt(new ObservableBody<ResponseData<ProblemFeedbackListBean>>());
    }

    public static Observable<ResponseData<AbnormalBean>> getAbnormalInfo(int task_id, int equipment_id, int equipment_part_item_id, String value) {
        return OkGo.<ResponseData<AbnormalBean>>get(HttpUrl.GET_ABNORMAL_INFO+"?task_id="+task_id+"&equipment_id="+equipment_id+"&equipment_part_item_id="+equipment_part_item_id+"&value="+value)
                .converter(new JsonConvert<ResponseData<AbnormalBean>>(){})
                .adapt(new ObservableBody<ResponseData<AbnormalBean>>());
    }

    public static Observable<ResponseData<ExpertReplyListBean>> expertReplyList(int page, int size, String replyStatus) {
        return OkGo.<ResponseData<ExpertReplyListBean>>get(HttpUrl.EXPERT_REPLY_LIST)
                .params("page",page)
                .params("size",size)
                .params("replyStatus",replyStatus)
                .converter(new JsonConvert<ResponseData<ExpertReplyListBean>>(){})
                .adapt(new ObservableBody<ResponseData<ExpertReplyListBean>>());
    }

    public static Observable<ResponseData<ExpertReplyDetailBean>> expertReplyDetail(int problemFeedbackId) {
        return OkGo.<ResponseData<ExpertReplyDetailBean>>get(HttpUrl.EXPERT_REPLY_DETAIL+problemFeedbackId)
                .converter(new JsonConvert<ResponseData<ExpertReplyDetailBean>>(){})
                .adapt(new ObservableBody<ResponseData<ExpertReplyDetailBean>>());
    }

    public static Observable<ResponseData<List<UploadFileRet>>> expertReplyUploadMultiFile(List<File> files,int problemFeedbackId) {
        return OkGo.<ResponseData<List<UploadFileRet>>>post(HttpUrl.EXPERT_REPLY_UPLOAD_MULTIFILE)
                .addFileParams("file", files)
                .params("problemFeedbackId",problemFeedbackId)
                .converter(new JsonConvert<ResponseData<List<UploadFileRet>>>(){})
                .adapt(new ObservableBody<ResponseData<List<UploadFileRet>>>());
    }

    public static Observable<ResponseData<Integer>> getManagerUserId(String taskId) {
        return OkGo.<ResponseData<Integer>>get(HttpUrl.GET_MANAGER_USER_ID)
                .params("taskId",taskId)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());
    }

    public static Observable<ResponseData> guideLike(String roomId) {
        return OkGo.<ResponseData>post(HttpUrl.GUIDE_LIKE+roomId)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());

    }

    public static Observable<ResponseData<Integer>> commitUpload(String json) {
        return OkGo.<ResponseData<Integer>>post(HttpUrl.KNOWLEDGE_UPLOAD_COMMIT)
                .upJson(json)
                .converter(new JsonConvert<ResponseData<Integer>>(){})
                .adapt(new ObservableBody<ResponseData<Integer>>());

    }

    public static Observable<ResponseData> commitUploadSave(int knowledgeBaseId	) {
        return OkGo.<ResponseData>post(HttpUrl.KNOWLEDGE_UPLOAD_COMMIT_SAVE)
                .params("knowledgeBaseId",knowledgeBaseId)
                .converter(new JsonConvert<ResponseData>(){})
                .adapt(new ObservableBody<ResponseData>());

    }

    public static Observable<ResponseData<AllTaskBean>> getAllTaskList(int pageInde,int pageSize,Integer state) {
        return OkGo.<ResponseData<AllTaskBean>>post(HttpUrl.GET_ALL_TASK)
                .params("pageIndex", pageInde)
                .params("pageSize", pageSize)
                .params("state", state)
                .converter(new JsonConvert<ResponseData<AllTaskBean>>(){})
                .adapt(new ObservableBody<ResponseData<AllTaskBean>>());
    }

    public static Observable<ResponseData<List<String>>> getTagType(String kks) {
        return OkGo.<ResponseData<List<String>>>get(HttpUrl.GET_TAG_TYPE)
                .params("kks",kks)
                .converter(new JsonConvert<ResponseData<List<String>>>(){})
                .adapt(new ObservableBody<ResponseData<List<String>>>());
    }

    public static Observable<ResponseData<List<FileBean>>> getWorkFileList(int taskId) {
        return OkGo.<ResponseData<List<FileBean>>>get(HttpUrl.GET_WORK_FILE_LIST+taskId)
                .converter(new JsonConvert<ResponseData<List<FileBean>>>(){})
                .adapt(new ObservableBody<ResponseData<List<FileBean>>>());
    }

    public static Observable<ResponseData<List<TrajectoryPoint>>> getPoint(String taskId) {
        return OkGo.<ResponseData<List<TrajectoryPoint>>>get(HttpUrl.GET_INSPECTION_POINT)
                .params("id",taskId)
                .converter(new JsonConvert<ResponseData<List<TrajectoryPoint>>>(){})
                .adapt(new ObservableBody<ResponseData<List<TrajectoryPoint>>>());
    }

    public static Observable<ResponseData<List<TrajectoryPoint>>> getInspectedPoint(String taskId) {
        return OkGo.<ResponseData<List<TrajectoryPoint>>>get(HttpUrl.GET_INSPECTIONED_POINT)
                .params("id",taskId)
                .converter(new JsonConvert<ResponseData<List<TrajectoryPoint>>>(){})
                .adapt(new ObservableBody<ResponseData<List<TrajectoryPoint>>>());
    }

    public static Observable<ResponseData<PlayBackBean>> getPointInspectInfo(JSONObject jsonObject) {
        return OkGo.<ResponseData<PlayBackBean>>post(HttpUrl.GET_POINT_INSPECTIONED_INFO)
                .upJson(jsonObject)
                .converter(new JsonConvert<ResponseData<PlayBackBean>>(){})
                .adapt(new ObservableBody<ResponseData<PlayBackBean>>());
    }

}
